<template>
  <el-card class="header">
    <div slot="header" class="clearfix">
      <div class="search-header">
        <span>线上热门搜索</span>
        <el-dropdown>
          <span>
            <i class="el-icon-more"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕</el-dropdown-item>
            <el-dropdown-item>狮子头</el-dropdown-item>
            <el-dropdown-item>螺蛳粉</el-dropdown-item>
            <el-dropdown-item>双皮奶</el-dropdown-item>
            <el-dropdown-item>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    <div>
      <el-row :gutter="10">
        <el-col :span="12">
          <LineChart></LineChart>
        </el-col>
        <el-col :span="12">
          <LineChart></LineChart>
        </el-col>
      </el-row>
      <!-- table表格 -->
      <el-table :data="tableData" style="width: 100%" border max-height="250">
        <el-table-column label="排名" width="80" type="index"></el-table-column>
        <el-table-column label="搜索关键字" width="180" prop="word"> </el-table-column>
        <el-table-column label="用户数" prop="user"> </el-table-column>
        <el-table-column label="周涨幅" prop="count"> </el-table-column>
      </el-table>
      <!-- 分页器 -->
    </div>
   <!--  <div class="block">
      <el-pagination layout="prev, pager, next" :total="tableData.length" :page-size="10" class="pagination"> </el-pagination>
    </div> -->
  </el-card>
</template>

<script>
import LineChart from "./LineChart";
import {mapState} from 'vuex'
export default {
  name: "Search",
  computed:{
     ...mapState({
       tableData:state=>state.home.list.searchWord||[]
     })
  },
  components: {
    LineChart,
  },
};
</script>

<style scoped>
.search-header {
  display: flex;
  justify-content: space-between;
}
.pagination{
   float: right;
}
</style>